home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 50
/
Volume 50 - JOGO DISK .iso
/
Games
/
barbie_winter.swf
/
000008.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2007-09-26
|
1KB
|
67 lines
xpos = [0];
var mouseListener = new Object();
var speed = 0;
var myx = 0;
var currentMouseOver;
var currentChar;
mouseListener.onMouseDown = function()
{
eval("_root.char" + currentChar)._y = 20000;
currentChar = currentMouseOver;
var i = currentMouseOver;
eval("_root.char" + i)._y = 256;
_root.marker2._yscale = 256 * 100;
_root.marker2._xscale = (xpos[i - 1] - xpos[i]) * 100;
_root.marker2._x = xpos[i] + myx;
};
mouseListener.onMouseMove = function()
{
if(_ymouse >= 256)
{
speed = 0;
}
else
{
speed = 256 >= Math.abs(_xmouse - 512) ? 0 : (512 - _xmouse) / 8;
}
};
setInterval(function()
{
if(_ymouse < 256)
{
var i;
var x = _xmouse - _root.textbar._x;
i = xpos.length - 1;
while(0 < i)
{
if(x < xpos[i - 1])
{
break;
}
i = eval("i") - 1;
}
currentMouseOver = i;
_root.marker._yscale = 256 * 100;
_root.marker._xscale = (xpos[i - 1] - xpos[i]) * 100;
_root.marker._x = xpos[i] + myx;
_root.textbar._x += 0.05;
}
if(0 >= myx + speed)
{
if(myx + speed < xpos[0] * -1 + 1024)
{
speed = 0;
}
}
else
{
speed = 0;
}
myx = eval("myx") + speed;
_root.textbar._x = myx;
_root.marker._x += speed;
_root.marker2._x += speed;
}
,20);
Mouse.addListener(mouseListener);